import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/login",
    name: "Login",
    component: () => import("@/views/login"),
  },
  {
    name: 'Home',
    path: '/',
    component: () => import('@/layout'),
    redirect: '/dashbord',
    children: [
      {
        name: 'Dashbord',
        path: '/dashbord',
        component: () => import('@/views/dashbord') // 路由懒加载
      }
    ]
  }
];

const router = new VueRouter({
  routes,
});

export default router;
